﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MVC5Test.Models
{

    public class LoginModel
    {
        [Display(Name = "邮箱")]
        [Required(ErrorMessage = "邮箱不能为空")]
        [StringLength(17, MinimumLength = 10, ErrorMessage = "邮箱长度不符合标准")]
        public string Email { get; set; }

        [Display(Name = "密码")]
        [DataType(DataType.Password)]
        [StringLength(8, MinimumLength = 6, ErrorMessage = "密码长度不符合标准,6~8位")]
        public string Password { get; set; }
    }

    /// <summary>
    /// 自定义ErrorMessage
    /// </summary>
    //public class LoginModel
    //{
    //    [Display(Name = "邮箱")]
    //    [Required]
    //    [StringLength(17, MinimumLength = 10)]
    //    public string Email { get; set; }

    //    [Display(Name = "密码")]
    //    [DataType(DataType.Password)]
    //    [StringLength(8, MinimumLength = 6)]
    //    public string Password { get; set; }
    //}
}